<?php
namespace Model;
use SDF\Db\MongoCollection;

/**
 * 供货商信息
 */
class suppliers extends MongoCollection{
    public function __construct(){
        parent::__construct('supplier','ismbao');
    }

    //获取某个供应商信息
    public function get_sup_info(){
        //供货商信息表
        //根据登陆后账号查询供货商信息;
        if(!session_id()){
            session_start();
        }
        $supplier_code = $_SESSION['supplier_code'];
        $query = array('supplier_code'=>$supplier_code);
        $supplier_info = $this->findOne($query);
        return $supplier_info;
    }
}